<?php

// 控制基类
class Controller extends Smarty
{
    // 初始化
    public function __construct()
    {
        // 链式风格
        $this->setTemplateDir('./views')
            ->setCompileDir('./runtime/views_c')
            ->setConfigDir('./configs')
            ->setCacheDir('./runtime/caches');
        $this->left_delimiter = '{{';
        $this->right_delimiter = '}}';
        $this->caching = false; // 开启缓存
        $this->cache_lifetime = 5; // +5s
    }

    public function __call($fun, $params)
    {
        header("HTTP/1.0 404 not found");
        echo '<h1>404 Not Found -- 控制器</h1>';
        exit;
    }
}


